﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WorkflowWizart.Lib.Utility.Costants;

namespace WorkflowWizart.Lib.Entities
{
    /// <summary>
    /// Item in workflow like method
    /// </summary>
    public class WorkflowItem 
    {
        public WorkflowItemTypes WorkflowItemType { get; set; }
        public string DisplayName { get; set; }
        public string Id
        {
            get
            {
                return DisplayName.Replace(" ", "_");
            }
        }

        /// <summary>
        /// Toolbox command to call from this item
        /// </summary>
        public string OperationCommandId { get; set; }

        /// <summary>
        /// Workflow to call from this item
        /// </summary>
        public string WorkflowId { get; set; }

        /// <summary>
        /// parameters to send command or workflow
        /// </summary>
        public List<WorkflowItemParameter> Parameters { get; set; }

        /// <summary>
        /// Workflow item can contains another item
        /// </summary>
        public WorkflowItem ParentItem { get; set; }

        /// <summary>
        /// items under this workflow item.
        /// </summary>
        public List<WorkflowItem> ChildItems { get; set; }

        /// <summary>
        /// fills after workflow executed
        /// </summary>
        public object Result { get; set; }

        /// <summary>
        /// index of this item in current workflow
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// workflow which contains this item
        /// </summary>
        public Workflow ParentWorkflow { get; set; }
    }
}
